import React, { Component } from 'react'
import PropTypes, { oneOfType } from 'prop-types'; // ES6

function Content(props) {
    return (<>
        <h1>内容组件</h1>
    </>)
}
Content.propTypes = {
    name: PropTypes.string,
    num: PropTypes.number,
    title: oneOfType([
        PropTypes.string,
        PropTypes.number,
        PropTypes.bool,
        PropTypes.array,
        PropTypes.object
    ]).isRequired, // isRequired 必填
    age: PropTypes.number.isRequired
}


export default class App extends Component {
    render() {
        return (
            <div>
                父级组件
                <hr />
                <Content name={'什么类型'} title='aaa' />
            </div>
        )
    }
}
